const angular = require('angular');
var app = angular.module('ita-app');

app.run(['$rootScope', '$transitions', '$http', function ($rootScope, $transitions, $http) {
    $transitions.onStart({ to: ['home','merchant.*'] }, function (trans) {
        var $state = trans.router.stateService;
        var isLogin = sessionStorage.getItem("manager");
        if(!isLogin){
            $state.go('login');
        }
    });
}]);